Integrand size = 20, antiderivative size = 61 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=-\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}-\frac {7 \arctan \left (\frac {1-2 x}{\sqrt {3}}\right )}{3 \sqrt {3}}+3 \log (x)-\frac {3}{2} \log \left (1-x+x^2\right ) \]
[Out]
Time = 0.05 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.300, Rules used = {1660, 1642, 648, 632, 210, 642} \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=-\frac {7 \arctan \left (\frac {1-2 x}{\sqrt {3}}\right )}{3 \sqrt {3}}+\frac {2 (x+1)}{3 \left (x^2-x+1\right )}-\frac {3}{2} \log \left (x^2-x+1\right )-\frac {1}{x}+3 \log (x) \]
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1642
Rule 1660
Rubi steps \begin{align*} \text {integral}& = \frac {2 (1+x)}{3 \left (1-x+x^2\right )}+\frac {1}{3} \int \frac {3+6 x+2 x^2}{x^2 \left (1-x+x^2\right )} \, dx \\ & = \frac {2 (1+x)}{3 \left (1-x+x^2\right )}+\frac {1}{3} \int \left (\frac {3}{x^2}+\frac {9}{x}+\frac {8-9 x}{1-x+x^2}\right ) \, dx \\ & = -\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}+3 \log (x)+\frac {1}{3} \int \frac {8-9 x}{1-x+x^2} \, dx \\ & = -\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}+3 \log (x)+\frac {7}{6} \int \frac {1}{1-x+x^2} \, dx-\frac {3}{2} \int \frac {-1+2 x}{1-x+x^2} \, dx \\ & = -\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}+3 \log (x)-\frac {3}{2} \log \left (1-x+x^2\right )-\frac {7}{3} \text {Subst}\left (\int \frac {1}{-3-x^2} \, dx,x,-1+2 x\right ) \\ & = -\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}-\frac {7 \tan ^{-1}\left (\frac {1-2 x}{\sqrt {3}}\right )}{3 \sqrt {3}}+3 \log (x)-\frac {3}{2} \log \left (1-x+x^2\right ) \\ \end{align*}
Time = 0.02 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=-\frac {1}{x}+\frac {2 (1+x)}{3 \left (1-x+x^2\right )}+\frac {7 \arctan \left (\frac {-1+2 x}{\sqrt {3}}\right )}{3 \sqrt {3}}+3 \log (x)-\frac {3}{2} \log \left (1-x+x^2\right ) \]
[In]
[Out]
Time = 0.67 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.90
method | result | size |
default | \(-\frac {-\frac {2 x}{3}-\frac {2}{3}}{x^{2}-x +1}-\frac {3 \ln \left (x^{2}-x +1\right )}{2}+\frac {7 \sqrt {3}\, \arctan \left (\frac {\left (-1+2 x \right ) \sqrt {3}}{3}\right )}{9}-\frac {1}{x}+3 \ln \left (x \right )\) | \(55\) |
risch | \(\frac {-\frac {1}{3} x^{2}+\frac {5}{3} x -1}{x \left (x^{2}-x +1\right )}+\frac {7 \sqrt {3}\, \arctan \left (\frac {\left (-1+2 x \right ) \sqrt {3}}{3}\right )}{9}-\frac {3 \ln \left (4 x^{2}-4 x +4\right )}{2}+3 \ln \left (x \right )\) | \(59\) |
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.39 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=\frac {14 \, \sqrt {3} {\left (x^{3} - x^{2} + x\right )} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - 6 \, x^{2} - 27 \, {\left (x^{3} - x^{2} + x\right )} \log \left (x^{2} - x + 1\right ) + 54 \, {\left (x^{3} - x^{2} + x\right )} \log \left (x\right ) + 30 \, x - 18}{18 \, {\left (x^{3} - x^{2} + x\right )}} \]
[In]
[Out]
Time = 0.09 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.07 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=\frac {- x^{2} + 5 x - 3}{3 x^{3} - 3 x^{2} + 3 x} + 3 \log {\left (x \right )} - \frac {3 \log {\left (x^{2} - x + 1 \right )}}{2} + \frac {7 \sqrt {3} \operatorname {atan}{\left (\frac {2 \sqrt {3} x}{3} - \frac {\sqrt {3}}{3} \right )}}{9} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.89 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=\frac {7}{9} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - \frac {x^{2} - 5 \, x + 3}{3 \, {\left (x^{3} - x^{2} + x\right )}} - \frac {3}{2} \, \log \left (x^{2} - x + 1\right ) + 3 \, \log \left (x\right ) \]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 55, normalized size of antiderivative = 0.90 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=\frac {7}{9} \, \sqrt {3} \arctan \left (\frac {1}{3} \, \sqrt {3} {\left (2 \, x - 1\right )}\right ) - \frac {x^{2} - 5 \, x + 3}{3 \, {\left (x^{3} - x^{2} + x\right )}} - \frac {3}{2} \, \log \left (x^{2} - x + 1\right ) + 3 \, \log \left ({\left | x \right |}\right ) \]
[In]
[Out]
Time = 13.75 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.11 \[ \int \frac {1+x+x^2}{x^2 \left (1-x+x^2\right )^2} \, dx=3\,\ln \left (x\right )-\frac {\frac {x^2}{3}-\frac {5\,x}{3}+1}{x^3-x^2+x}-\ln \left (x-\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (\frac {3}{2}+\frac {\sqrt {3}\,7{}\mathrm {i}}{18}\right )+\ln \left (x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )\,\left (-\frac {3}{2}+\frac {\sqrt {3}\,7{}\mathrm {i}}{18}\right ) \]
[In]
[Out]